﻿using System.Globalization;
using System.Windows.Data;

namespace DimensionsHelper.Client.Converters;

[ValueConversion(typeof(bool), typeof(TextWrapping))]
public class BooleanToTextWrappingConverter : IValueConverter
{

    public static BooleanToTextWrappingConverter Instance => new();

    public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        return value is true ? TextWrapping.Wrap : TextWrapping.NoWrap;
    }

    public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        return Binding.DoNothing;
    }
}